package neuralModel.neuron;

import java.util.List;

import neuralModel.activationFunction.RadialActivationFunction;

public class RadialNeuron extends Neuron
{

	private RadialActivationFunction radialActivationFunction;
	private double[] inducedLoalField;
	private double[] center;

	public double[] getCenter()
	{
		return center;
	}

	public void setCenter(double[] center)
	{
		this.center = center;
	}

	public RadialNeuron(String name, RadialActivationFunction activationFunction, double[] center)
	{
		super(name, activationFunction);
		this.radialActivationFunction = activationFunction;
		this.center = center;
	}

	@Override
	public void updateInducedLocalField()
	{
		List<ISignal> signals = getInputSignalList();

		if (inducedLoalField == null)
		{
			inducedLoalField = new double[signals.size()];
		}

		for (int i = 0; i < signals.size(); i++)
		{
			inducedLoalField[i] = signals.get(i).getSignalValue();
		}
	}

	@Override
	public void updateOutputValue()
	{
		double sum = 0;
		for(ISignal signal : this.getInputSignalList())
			sum += signal.getWeightedValue();
		double newOutput = Math.sqrt( sum );
		this.setOutputValue(newOutput);
	}
	
	

}
